import QtQuick 2.12
import QtQuick.Controls 2.5
import QtQuick.Window 2.12

Window {

    visible: true
    width: 600
    height: 400
    title: "QML Load Dialog"

    Button {
        id: button
        text: "Read me"
        width: 200
        onClicked: {
            var component = Qt.createComponent("MyDialog.qml")
            var obj = component.createObject(overlay)
            obj.target = button
        }
    }

    Item {
        id: overlay
        anchors.fill: parent
    }
}
